package cn.edu.scau.cmi.linyuetao.singleton;

import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class General{
    private final StringProperty name;

    private static General[] generals = new General[10];

    private General(String name) {
        this.name = new SimpleStringProperty(name);
    }

    public static General getInstance(String name) {
        if (IndexViewController.generalNumbers < 10) {
            return new General(name);
        }
        return null;
    }

    public String getName() {
        return name.get();
    }

    public static General[] getGenerals() {
        return generals;
    }


}

